package com.jt.demo1;

import com.jt.demo1.config.SpringConfig;
import com.jt.demo1.proxy.JDKProxy;
import com.jt.demo1.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class SpringTx {


    public static void main(String[] args) {
        ApplicationContext context=
                new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = context.getBean(UserService.class);
        UserService proxy = (UserService) JDKProxy.getProxy(userService);

        userService.userAdd();
        System.out.println(proxy);
        userService.deleteUser();

    }

}
